﻿<%if not in_sdcms then response.write("template load fail"):response.end() end if%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Keywords" content="{sdcms[seokey]}" />
<meta name="Description" content="{sdcms[seodesc]}" />
<title>{sdcms[webname]}</title>
<link href="{webroot}lib/css/base.css" rel="stylesheet" type="text/css" />
<link href="{webroot}theme/default/css/public.css" rel="stylesheet" type="text/css" />
<link href="{webroot}theme/default/css/user_base.css" rel="stylesheet" type="text/css" />
<link href="{webroot}theme/default/css/user.css" rel="stylesheet" type="text/css" />
<link href="{webroot}theme/default/css/user_bind.css" rel="stylesheet" type="text/css" />
<script>var webroot="{webroot}";</script>
<script src="{webroot}lib/js/jquery.js"></script>
<script src="{webroot}lib/js/jquery-migrate-1.1.0.min.js"></script>
<script src="{webroot}lib/tips/jquery.tips.js"></script>
<script src="{webroot}lib/js/base.js"></script>
{if sdcms[sys_mobile]}<script src="{webroot}lib/js/mobile.js"></script>{/if}
<script src="{webroot}lib/validator/jquery.validator.js"></script>
<script src="{webroot}lib/validator/zh_CN.js"></script>
<script src="{webroot}theme/default/js/sdcms.js"></script>
<script>
$(function(){
	$("#user_menu_04").addClass("hover");
	
	$(".form_exchange").validator(
	{
		stopOnError:true,
		theme:'yellow_right_effect',
		ignore:':hidden',
		beforeSubmit:function(){
			$("input[type='submit']").attr("disabled",true);
		},
		valid:function(form)
		{
			$.fn.tips({type:'loading',content:'数据提交中'});
			$.ajax(
			{
				url:"?act=db",
				type:"post",
				data:$(form).serialize(),
				success:function(data){
					data=jQuery.parseJSON(data);
					var type="warn";
					if(data.status=="y"){type="ok";}
					$.fn.tips({type:type,content:data.info});
					if(data.status=="y")
					{
						setTimeout(function(){location.href="?"},1000);
					}
				}
			});
		},
		invalid:function(){$("input[type='submit']").attr("disabled",false);}
	});
	
});
</script>
</head>
<body>
    {sdcms:include("../sdcms_head.asp")}
    
    <div id="position">您所在的位置：<a href="{webroot}">首页</a> > <a href="./">会员中心</a></div>
    <div class="w980 mt10 mc">
        {sdcms:include("sdcms_menu.asp")}
        <div class="right_big">
            <div class="b">
                <div class="subject">积分兑换</div>
                <div class="p35">
                
                    {dim userdata:userdata=sdcms.userinfo}
                    <form class="form_exchange" method="post">
                    <ul id="onlinepay">
                        {sdcms:rs field="amount,point" table="sd_user" where="id=[userdata(0)]"}
                        <li>可用积分：<span>{$rs[point]}</span></li>
                        <li>兑换比例：<span> 1 </span>元 兑换 <span> {sdcms[str_exchange]} </span>积分</li>
                        <li>兑换金额：<input type="text" name="t0" id="t0" class="ip" maxlength="10" data-rule="兑换金额:required;digits;" />　余额：<span>{sdcms.getnum($rs[amount])}</span> 元 <span for="t0" class="msg-box"></span></li>
                        <li>登录密码：<input type="password" name="t1" class="ip" maxlength="20" data-rule="登录密码:required;password;" /></li>
                        <dd><input type="submit" value="下一步" class="bnt_blue" /> <input type="button" value="取消" onclick="location.href='javascript:history.go(-1)'" class="bnt_blue" /></dd>
                        {/sdcms:rs}
                    </ul>
                    </form>
                
                </div>
            </div>
        </div>
    </div>
    {sdcms:include("../sdcms_foot.asp")}